<script src=protobuf.min.js></script>
<script src=proto-bili-gen.js></script>
<script>
    let proto_seg = protobuf.roots.default.bilibili.community.service.dm.v1.DmSegMobileReply;
    let proto_view = protobuf.roots.default.bilibili.community.service.dm.v1.DmWebViewReply;

    y = new XMLHttpRequest;
    y.open('get', 'seg.so', true);
    y.responseType = 'arraybuffer';
    y.addEventListener('load', () => {
        let d = proto_seg.decode(new Uint8Array(y.response));
        console.log('seg', d);
    });
    y.send();

    x = new XMLHttpRequest;
    x.open('get', 'view', true);
    x.responseType = 'arraybuffer';
    x.addEventListener('load', () => {
        let d = proto_view.decode(new Uint8Array(x.response));
        console.log('view', d);
    });
    x.send();
</script>